package com.heima.recommend.job;

import com.heima.recommend.service.HotArticleService;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;


@Component
@Slf4j
public class XxlArticleJob {

    @Resource
    private HotArticleService hotArticleService;

    /**
     * 定时扫描待发布的文章
     */
    @XxlJob("computeHotArticle")
    public void scanWmNews() {
        log.info("计算热文章任务开始执行---------------------");
        hotArticleService.computeHotArticle();
        log.info("计算热文章任务执行结束---------------------");
    }
}
